package com.woniu.woniuYoga.comm.web.util;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;


/**
 * @author: 付宽成
 * @description: TokenUtil 获取响应头中的 token
 * @date: 2020/8/25 11:02
 * @version: 1.0
 */
public class TokenUtil {

    public static String getToken(){
        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        return attributes.getRequest().getHeader("X-Token");
    }
}
